#pragma once
#include <memory>
#include <map>
#include <string>
#include <list>
#include "../../utils/common_ptr.h"

class SQLParserFeature
{
public:
  static SQLParserFeature KeepInsertValueClauseOriginalString;
  static SQLParserFeature KeepSelectListOriginalString; // for improved sql parameterized performance
  static SQLParserFeature UseInsertColumnsCache;
  static SQLParserFeature EnableSQLBinaryOpExprGroup;
  static SQLParserFeature OptimizedForParameterized;
  static SQLParserFeature OptimizedForForParameterizedSkipValue;
  static SQLParserFeature KeepComments;
  static SQLParserFeature SkipComments;
  static SQLParserFeature StrictForWall;

  static SQLParserFeature TDDLHint;
  static SQLParserFeature DRDSAsyncDDL;
  static SQLParserFeature DRDSBaseline;
  static SQLParserFeature InsertReader;
  static SQLParserFeature IgnoreNameQuotes;
  static SQLParserFeature KeepNameQuotes; // for ads, presto

  static SQLParserFeature SelectItemGenerateAlias;

  static SQLParserFeature PipesAsConcat; // for mysql

  static SQLParserFeature InsertValueCheckType;

  static SQLParserFeature InsertValueNative;

  static SQLParserFeature EnableCurrentTimeExpr;
  static SQLParserFeature EnableCurrentUserExpr;

  static SQLParserFeature KeepSourceLocation;

  static SQLParserFeature SupportUnicodeCodePoint;
  static SQLParserFeature PrintSQLWhileParsingFailed;
  static SQLParserFeature EnableMultiUnion;

  static SQLParserFeature Spark;
  static SQLParserFeature Presto;
  static SQLParserFeature MySQLSupportStandardComment;

private:
  std::shared_ptr<std::map<u_int64_t, string_ptr>> str;
  std::shared_ptr<std::map<string_ptr, u_int64_t>> str_int;

public:
  SQLParserFeature();
  SQLParserFeature(SQLParserFeature *sqlParserFeature);
  SQLParserFeature(int mask, string_ptr name);
  bool operator==(SQLParserFeature &rgt);
  string_ptr toString();
  int value();
  string_ptr toString(SQLParserFeature &val, BOOL_ptr ucase);
  static BOOL_ptr isEnabled(int features, SQLParserFeature_ptr feature);
  static u_int64_t config(int features, SQLParserFeature_ptr feature, BOOL_ptr state);
  uint64_t of(SQLParserFeature_list_ptr features);
  uint64_t mask;
  string_ptr name;
};
